DateDiff Functoid
The DateDiff Functoid calculates the delta between two given dates in the specified time unit.
Picture of the DateDiff Functoid
Inputs with their allowed values:
- InputDateLeft
- Any date and time value in almost any possible format
- Literal Text entered manually
- Output of another Functoid
- Value of a Table
- FormatLeft
- This parameter defines with which format the InputDateLeft parameter should be read. If the value in InputDateLeft does not meet the format criteria specified here it will result in an error message which will be inserted as result instead of a delta calculation.
- Use y for the year part of the date
- Use M for the month part of the date
- Use d for the day part of the date
- Use H for the hour part of the time
- Use m for the minutes part of the time
- Use s for the seconds part of the time
- Use f for the fraction of seconds
- Use hh and tt for 12 hour and am or pm notation (capitals are not supported)
- InputDateRight
- Any date and time value in almost any possible format
- Literal Text entered manually
- Output of another Functoid
- Value of a Table
- FormatRight
- This parameter defines with which format the InputDateRight parameter should be read. If the value in InputDateRight does not meet the format criteria specified here it will result in an error message which will be inserted as result instead of a delta calculation. For example "09-12-2006" would be accepted by Format "dd-MM-yyyy", but "9-12-2006" would not.
- Use y for the year part of the date
- Use M for the month part of the date
- Use d for the day part of the date
- Use H for the hour part of the time
- Use m for the minutes part of the time
- Use s for the seconds part of the time
- Use f for the fraction of seconds
- Use hh and tt for 12 hour and am or pm notation (capitals are not supported)
- ReturnPart
- d : for returning days
- H : for returning hours
- M : for returning minutes
- S : for returning seconds
Example:
- InputDateLeft
- FormatLeft
- InputDateRight
- FormatRight
- ReturnPart
- Output
See Figure 1. Note: If the date value notation does not match FormatLeft and/or FormatRight the output of the DateDiff functoid will be an error message. This error message will display the input values (respectively InputDateLeft and InputDateRight) prefixed with "Invalid date detected: ".
Figure 1